﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=1340, initial-scale=0.9" />
    <meta name="renderer" content="ie-comp" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="renderer" content="webkit">
    <title>班级新闻</title>
    <link rel="stylesheet" type="text/css" href="css/base.css">
    <link rel="stylesheet" type="text/css" href="css/base1.css">
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <link rel="stylesheet" type="text/css" href="css/index-content.css">
    <link rel="stylesheet" type="text/css" href="css/content.css">
    <link rel="stylesheet" type="text/css" href="css/content1.css">
    <link rel="stylesheet" href="css/jquery-tool.css" type="text/css" />
    <link rel="stylesheet" href="css/default.css?V=2" />
    <script type="text/javascript" src="js/jquery.1.9.1.js"></script>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.SuperSlide.2.1.js"></script>

    <script src="js/avalon1.47.js"></script>
    <script src="/View/JS/FTCommon.js"></script>
    <script>
        var model = avalon.define({
            $id: "Index",
            LMData: [],//最新新闻，前8条
            LBData: [],//列表信息
            select: function (item) {
                for (var i = 0; i < model.LMData.length; i++) {
                    model.LMData[i].isselect = false;
                }
                item.isselect = true;
                $.getJSON("/API/VIEWAPI.ashx?Action=Commanage_GETNRLIST&r=" + Math.random(), { P1: item.ID, p: 1, pagecount: 20, P2: "" }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        model.LBData = resultData.Result;
                    }
                })
            },
            stop: function () {
                music = document.getElementById("bgmusic");
                $("#audio_btn").toggleClass("rotate"); //控制音乐图标 自转或暂停
                music.pause();
            }
        })
        avalon.ready(function () {
            $.getJSON("/API/VIEWAPI.ashx?Action=Commanage_GETLMLIST&r=" + Math.random(), {}, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    var lb = ComFunJS.getQueryString("lb");
                    for (var i = 0; i < resultData.Result[0].Item.length; i++) {
                        if (lb == resultData.Result[0].Item[i].ID) {
                            resultData.Result[0].Item[i].isselect = true;
                            $.getJSON("/API/VIEWAPI.ashx?Action=Commanage_GETNRLIST&r=" + Math.random(), { P1: lb, p: 1, pagecount: 20, P2: "" }, function (resultData) {
                                if (resultData.ErrorMsg == "") {
                                    model.LBData = resultData.Result;
                                }
                            })
                        } else {
                            resultData.Result[0].Item[i].isselect = false;

                        }
                    }
                    model.LMData = resultData.Result[0].Item;
                }
            })
        })
    </script>
</head>

<body ms-controller="Index">

    <script type="text/javascript">
        var COOKIE = {
            get: function (key) {
                var arr = document.cookie.match(new RegExp("(?:^| )" + key + "=([^;]*)(?:;|$)"));
                return arr ? arr[1] : '';
            },
            set: function (key, value, days, path) {
                var s = key + "=" + (value);
                if (days) {
                    var exp = new Date();
                    exp.setDate(exp.getDate() + (days || 1));
                    s += ";expires=" + exp.toGMTString();
                }
                if (path) s += ";path=" + path;
                document.cookie = s;
            },
            del: function (key, path) {
                this.set(key, "", -1, path);
            }
        };
        function getCookie(key) {
            return COOKIE.get(key);
        }
    </script>

    <div class="nkhead">
        <div class="wrapper1075 margin  clear" style="margin-top:10px;margin-bottom:10px">
            <a  style="font-size:36px">
                班级主页
            </a>
            <!--<div class="right nksearch clear">
                <input class="nksearchL left" type="text" placeholder="请输入关键字">
                <input class="nksearchR right" type="button">
            </div>-->
        </div>
    </div>

    <!-- 导航 end -->
    <div class="nknav">
        <div class="nknavwrapper margin f16 tc clear">
            <a  href="index.html">班级主页</a>
            <a href="bjcy.html">班级成员信息</a>
            <a class="on" href="news.html">班级新闻</a>
            <a href="bjzp.html">班级相册</a>

        </div>
    </div>


    <div style="background: url(images/YX/bg.jpg) top center no-repeat; background-size: 100%;">

        <!--<div class="mt80">-->

        <div class="pt pb">
            <div class="wrapper1000 margin consearchBox clear mt20">
                <div class="left newsL whitebg">
                    <div class="newsLTitle">栏目列表</div>
                    <div class="newsList">
                        <a class="on">班级新闻</a>
                    </div>
                    <!--<div class="newsLTitle">热点内容</div>
                        <div class="newsList1">

                        </div>-->
                </div>
                <div class="right newsR">
                    <div ms-repeat-item="LMData" class="newsRtitle" ms-visible="item.isselect" style="background-color: white;">{{item.Name}}</div>
                    <div class="newsRlist" style="min-height: 600px; background-color: white;">
                        <div>
                            <div ms-repeat-item="LBData" class="newsContentList f14">
                                <a ms-attr-title="{{item.Title}}" target="_blank" ms-attr-href="news-detailed.html?ID={{item.ID}}" style="padding-left: 20px"><span class="ntext">{{ComFunJS.convstr(item.Title,50)}}</span><span class="ntay">[{{item.CRDate|date('MM-dd')}}]</span></a>


                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <!--</div>-->
        </div>
    </div>





    <!-- banner end -->
    <!-- 正文一 start -->
    <!-- 链接 end -->
    <!-- 单位头信息 -->
    <!-- 底部 start -->

    <div id="foot" class="footer">
        Copyright © 2017 All Rights Reserved.<br>
        常州大学 版权所有 | <a href="../View/Login.aspx" style="border: 0px;">后台管理</a>
    </div>

    <!-- 底部 end -->

    <script type="text/javascript">
        //窗口效果
        //点击登录class为uodowntc 显示
        function showLoginDiv() {
            $("#gray").show();
            $("#popup").show();//查找ID为popup的DIV show()显示#gray
            tc_center();
        }
        //点击关闭按钮
        $("a.guanbi2").click(function () {
            $("#gray").hide();
            $("#popup").hide();//查找ID为popup的DIV hide()隐藏
        });
        //窗口水平居中
        $(window).resize(function () {
            tc_center();
        });

        function tc_center() {
            var _top = ($(window).height() - $(".popup").height()) / 2;
            var _left = ($(window).width() - $(".popup").width()) / 2;
            $(".popup").css({
                top: _top,
                left: _left
            });
        }

        $(document).ready(function () {
            $(".top_nav").mousedown(function (e) {
                $(this).css("cursor", "move");//改变鼠标指针的形状
                var offset = $(this).offset();//DIV在页面的位置
                var x = e.pageX - offset.left;//获得鼠标指针离DIV元素左边界的距离
                var y = e.pageY - offset.top;//获得鼠标指针离DIV元素上边界的距离
                $(document).bind("mousemove", function (ev) { //绑定鼠标的移动事件，因为光标在DIV元素外面也要有效果，所以要用doucment的事件，而不用DIV元素的事件
                    $(".popup").stop();//加上这个之后
                    var _x = ev.pageX - x;//获得X轴方向移动的值
                    var _y = ev.pageY - y;//获得Y轴方向移动的值
                    $(".popup").animate({
                        left: _x,
                        top: _y
                    }, 10);
                });
            });
            $(document).mouseup(function () {
                $(".popup").css("cursor", "default");
                $(this).unbind("mousemove");
            });
        })

        function logout() {
            var data = { method: "logoutnoredirect", params: { domain: "mycloud.com", loginid: getCookie("un") }, token: getCookie(getCookie("un")) };
            $.ajax({
                type: 'POST',
                url: '/app/mycloud',
                data: {
                    jsonParams: encodeURIComponent(JSON.stringify(data))
                },
                dataType: 'json',
                success: function (data) {
                    if (data.errorCode == "0") {
                        window.location.reload();
                    }
                }
            })
        }
        function init() {
            var arr = document.cookie.match(new RegExp("(?:^| )" + "loginid" + "=([^;]*)(?:;|$)"));
            var un = arr ? arr[1] : '';
            //un=decodeURIComponent(un).replace(/"/g,'');
            $("#username").val(un);

            $("#username,#password").on("keydown", function (e) {
                if (e.keyCode === 13) $("#loginSubmit").click()
            }
            );
            var passwordTip, usernameTip, loadingGid = $("#loadingGid");
            $("#loginSubmit").click(function () {
                var _submitBtn = this;
                if (_submitBtn.disabled === true) return;
                var username = $.trim($("#username").val());
                var password = $.trim($("#password").val());
                if (username == '') {
                    $("#username").focus();
                    return
                };
                if (password == '') {
                    $("#password").focus();
                    return
                };
                _submitBtn.disabled = true;
                var config = {
                    method: 'login',
                    params: {
                        domain: "mycloud.com",
                        loginid: username,
                        password: password,
                        isRemember: true
                    }
                };
                $.ajax({
                    type: 'POST',
                    url: '/app/mycloud',
                    data: {
                        jsonParams: encodeURIComponent(JSON.stringify(config))
                    },
                    dataType: 'json',
                    complete: function () {
                        _submitBtn.disabled = false;
                    },
                    success: function (data) {
                        if (data.errorCode == "0") {
                            window.location.reload();
                        } else {
                            if (data.errorCode == 300001) {
                                alert(data.errorMessage);
                            }
                            else if (data.errorCode == 100003) {
                                alert(data.result);
                            }
                            else {
                                alert(data.errorMessage);
                            }
                        }
                    }
                });
            });
        }
        init();
    </script>
    <div style="display: none;">
        <script src="http://s4.cnzz.com/z_stat.php?id=1261316249&web_id=1261316249" language="JavaScript"></script>
    </div>
    </div>
    <script>
        function sel(pageNum) {
            document.location.href = "/portal/zkx/gztzList.action?page=" + pageNum;
        }
        function getPage(pageNum) {
            document.location.href = "/portal/zkx/gztzList.action?page=" + pageNum;
        }
    </script>


</body>
</html>

